# NOT RUN {
# Plot Saxton's water retention curve
psi = seq(0, -6.0, by=-0.01)
plot(-psi, lapply(as.list(psi), FUN=soil.psi2thetaSX, clay=40, sand=10, om = 1),
type="l", ylim=c(0,0.6),ylab="Water content (prop. volume)",
xlab = "Soil water potential (-MPa)")
#Determine USDA soil texture type
type = soil.USDAType(clay=40, sand=10)
type
#Van Genuchten's params (bulk density = 1.3 g/cm)
vg = soil.vanGenuchtenParamsToth(40,10,1,1.3,TRUE)
vg
#Add Van Genuchten water retention curve
lines(-psi, lapply(as.list(psi), FUN=soil.psi2thetaVG, alpha=vg[1], n = vg[2],
theta_res = vg[3], theta_sat = vg[4]), lty=2)
legend("topright", legend=c("Saxton", "Van Genuchten"), lty=c(1,2), bty="n")
# }
Run the code above in your browser using DataLab